package com.joseph.websocket.io;

import org.apache.dubbo.common.utils.NetUtils;
import org.springframework.aop.support.AopUtils;

import java.io.IOException;
import java.io.InputStream;
import java.net.*;
import java.util.Enumeration;

public class OioClient {

    public static void main(String[] args) throws IOException {
        System.out.println("prepare InetAddress");
        InetAddress addr = InetAddress.getLocalHost();
        System.out.println("succ: " + addr );
        System.out.println("succ: " + addr.getHostAddress()

        );
        Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
        while (networkInterfaces.hasMoreElements()) {
            System.out.println(networkInterfaces.nextElement().getInetAddresses().nextElement().getHostAddress());
        }

    }


}
